package com.cet.lxf.oop.test05;

/**
 * @program: algorithm
 * @description: 枚举类
 * @author: 陈恩涛
 * @create: 2021-06-28 10:51
 **/
public class Main01 {
    public static void main(String[] args) {
        Weekday day = Weekday.SUN;
        if (day.getDayValue() == 6 || day.getDayValue() == 0) {
            System.out.println("Today is " + day + ". Work at home!");
        } else {
            System.out.println("Today is " + day + ". Work at office!");
        }
    }
}

enum Weekday {
    /**
     * 星期一
     */
    MON(1, "星期一"),
    /**
     * 星期二
     */
    TUE(2, "星期二"),
    /**
     * 星期三
     */
    WED(3, "星期三"),
    /**
     * 星期四
     */
    THU(4, "星期四"),
    /**
     * 星期五
     */
    FRI(5, "星期五"),
    /**
     * 星期六
     */
    SAT(6, "星期六"),
    /**
     * 星期日
     */
    SUN(0, "星期日");

    private final int dayValue;
    private final String chinese;

    Weekday(int dayValue, String chinese) {
        this.dayValue = dayValue;
        this.chinese = chinese;
    }

    public int getDayValue() {
        return dayValue;
    }

    public String getChinese() {
        return chinese;
    }

    @Override
    public String toString() {
        return this.chinese;
    }
}
